<?php
namespace app\model;
use think\Model;

class UserAccount extends Model
{
    // protected $table = 'user';
    // protected $autoWriteTimestamp = true;

    public function getInfoByWorkNum($num){
        try {
            $data = $this->where('work_num',$num)->find();
            return [true,$data];
            //code...
        } catch (\Exception $e) {
            return [false,$e->getMessage()];
            //throw $th;
        }
    //    return $this->where('work_num',$num)->find();
    }

    public function getAllWorkNum(){
        try {
            $data = $this->withAttr('work_num')->select();
            return [true,$data];
            //code...
        } catch (\Exception $e) {
            return [false,$e->getMessage()];
            //throw $th;
        }
    }
}
